package myblc

import "fmt"

func init()  {
	//myblock := NewBlock("shang gu wen du",1, []byte{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})

	myblock := CreateGenesisBlock("shang gu wen du")
	fmt.Println(myblock)

	fmt.Println("********************************")
	myblockchain := CreateBlockchainWithGenesisBlock()

	myblockchain.AddBlockToBlockchain("huang",myblockchain.Blocks[len(myblockchain.Blocks)-1].Height + 1, myblockchain.Blocks[len(myblockchain.Blocks)-1].Hash)
	myblockchain.AddBlockToBlockchain("zong",myblockchain.Blocks[len(myblockchain.Blocks)-1].Height + 1, myblockchain.Blocks[len(myblockchain.Blocks)-1].Hash)
	myblockchain.AddBlockToBlockchain("shan",myblockchain.Blocks[len(myblockchain.Blocks)-1].Height + 1, myblockchain.Blocks[len(myblockchain.Blocks)-1].Hash)

	fmt.Println(myblockchain)
	fmt.Println(myblockchain.Blocks)

}